/**
 * Created by Administrator on 2017/11/7.
 * Copyright 2017-2018 汉威.智慧环保事业部 Limited.
 * All rights reserved.
 */
package com.hw.one.collect.radar.po;

import com.hw.one.collect.radar.util.RegexUtil;

import java.io.Serializable;

public class RadarSitePo implements Serializable {

    // 雷达设备基础属性
    private String id;
    private String SNCode;
    private String monitorCode;
    // 对应的站点属性
    private String siteCode;
    private String siteName;
    private String regionCode;
    private String siteTypeCode;
    private String longitude;
    private String latitude;
    private String address;
    private String parameter;

    private double radius = 5000;
    private String limit; // 栅格报警的设置;格式为：100##pm25##total##value/100##pm10##avg##value...
    private String max = "Avg";

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSNCode() {
        return SNCode;
    }

    public void setSNCode(String SNCode) {
        this.SNCode = SNCode;
    }

    public String getMonitorCode() {
        return monitorCode;
    }

    public void setMonitorCode(String monitorCode) {
        this.monitorCode = monitorCode;
    }

    public String getSiteCode() {
        return siteCode;
    }

    public void setSiteCode(String siteCode) {
        this.siteCode = siteCode;
    }

    public String getSiteName() {
        return siteName;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    public String getRegionCode() {
        return regionCode;
    }

    public void setRegionCode(String regionCode) {
        this.regionCode = regionCode;
    }

    public String getSiteTypeCode() {
        return siteTypeCode;
    }

    public void setSiteTypeCode(String siteTypeCode) {
        this.siteTypeCode = siteTypeCode;
    }

    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public double getRadius() {
        if (null == parameter || "".equals(parameter)) {
            return radius;
        }
        String[] parameterStr = parameter.split(",");
        if (parameterStr.length > 0 && RegexUtil.isDouble(parameterStr[0])) {
            radius = Double.valueOf(parameterStr[0]);
        }
        return radius;
    }

    public String getLimit() {
        if (null == parameter || "".equals(parameter)) {
            return "";
        }
        String[] parameterStr = parameter.split(",");
        if (parameterStr.length > 1 && null != parameterStr[1]) {
            return parameterStr[1];
        }
        return "";
    }

    public String getParameter() {
        return parameter;
    }

    public void setParameter(String parameter) {
        this.parameter = parameter;
    }

    public String getMax() {
        if (null == parameter || "".equals(parameter)) {
            return max;
        }
        String[] parameterStr = parameter.split(",");
        if (parameterStr.length > 2 && null != parameterStr[2]) {
            max = parameterStr[2];
        }
        return max;
    }
}
